/*
 * configuration.cpp
 *
 *  Created on: 26 Oca 2012
 *      Author: root
 */

#include "and_config.h"

namespace androidplus {

and_config::and_config(AConfiguration* conf) :
		aconf(conf) {
	lang[0] = 0;
	lang[1] = 0;
	lang[2] = 0;
	if(aconf!=NULL)
	AConfiguration_getLanguage(aconf, lang);

	country[0] = 0;
	country[1] = 0;
	country[2] = 0;
	if(aconf!=NULL)
	AConfiguration_getCountry(aconf, country);

}

and_config::~and_config() {
	if(aconf!=NULL)
	AConfiguration_delete(aconf);

}



void and_config::print_config() {
	LOGI("Config: mcc=%d mnc=%d lang=%s cnt=%s orien=%d touch=%d dens=%d keys=%d"
			" nav=%d keysHid=%d navHid=%d sdk=%d size=%d long=%d modetype=%d modenight=%d",
			get_mcc(), get_mnc(), get_language(), get_country(), get_orientation(),
			get_touch_sreen(), get_density(), get_keyboard(), get_navigation(),
			get_keys_hidden(), get_nav_hidden(), get_sdk_version(),
			get_screen_size(), get_screen_long(), get_ui_mode_type(),
			get_ui_mode_night());
}

const char * and_config::get_language() const {
	return lang;
}
const char * and_config::get_country() const {

	return country;

}
const int32_t and_config::get_mcc() const {
	return AConfiguration_getMcc(aconf);
}
const int32_t and_config::get_mnc() const {
	return AConfiguration_getMnc(aconf);

}
const int32_t and_config::get_orientation() const {
	return AConfiguration_getOrientation(aconf);

}
const int32_t and_config::get_touch_sreen() const {
	return AConfiguration_getTouchscreen(aconf);

}
const int32_t and_config::get_density() const {
	return AConfiguration_getDensity(aconf);

}
const int32_t and_config::get_keyboard() const {
	return AConfiguration_getKeyboard(aconf);
}
const int32_t and_config::get_navigation() const {
	return AConfiguration_getNavigation(aconf);
}
const int32_t and_config::get_keys_hidden() const {
	return AConfiguration_getKeysHidden(aconf);

}
const int32_t and_config::get_nav_hidden() const {
	return AConfiguration_getNavHidden(aconf);

}
const int32_t and_config::get_sdk_version() const {
	return AConfiguration_getSdkVersion(aconf);

}
const int32_t and_config::get_screen_size() const {
	return AConfiguration_getScreenSize(aconf);
}
const int32_t and_config::get_screen_long() const {
	return AConfiguration_getScreenLong(aconf);
}
const int32_t and_config::get_ui_mode_type() const {
	return AConfiguration_getUiModeType(aconf);
}
const int32_t and_config::get_ui_mode_night() const {
	return AConfiguration_getUiModeNight(aconf);
}

} /* namespace AndroidPlus */
